﻿use employees
go
------------------4----------------------------------------------------------------
SELECT 
[Dept].[ID], 
Count([Empl].[ID]) AS [AMOUNT]
FROM [dbo].[Dept] INNER JOIN[dbo].[Empl] ON [Dept].[ID] = [Empl].[DeptID]
GROUP BY [Dept].[ID]
ORDER BY [AMOUNT] DESC

SELECT 
[Empl].[DeptID], 
Count([Empl].[ID]) AS [AMOUNT]
FROM [dbo].[Empl] 
GROUP BY [Empl].[DeptID]
ORDER BY [AMOUNT] DESC

SELECT 
[Dept].[ID], 
Count([Empl].[ID]) AS [AMOUNT]
FROM [dbo].[Dept], [dbo].[Empl] 
WHERE [Dept].[ID] = [Empl].[DeptID] 
GROUP BY [Dept].[ID]
ORDER BY [AMOUNT] DESC

